//
//  ViewController.m
//  ScrollViewDemo
//
//  Created by liuyan on 2017/8/24.
//  Copyright © 2017年 liuyan.com. All rights reserved.
//

#import "ViewController.h"
#import "WHScrollAndPageView.h"
#import "YDLScrollView.h"

#define NUM 5

@interface ViewController ()<YDLScrollViewDelegate>
@property (nonatomic, strong) YDLScrollView *ydlScrollView;

@end


@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    [self uiconfig];
}

-(void)uiconfig{
    self.ydlScrollView = [[YDLScrollView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, 300) withDistanceForScroll:20.0f withGap:15.0f];
    self.ydlScrollView.delegate = self;
    [self.view addSubview:self.ydlScrollView];
    NSArray *arr = @[@"640x1136-1.jpg", @"640x1136-2.jpg", @"640x1136-3.jpg", @"640x1136-4.jpg"];
    [self.ydlScrollView ydlScrollView:arr];
}

#pragma mark - 滚动视图协议 
-(void)didSelectPicWithIndexPath:(NSInteger)index{
    if (index != -1) {
        NSLog(@"%ld", (long)index);
    }
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
